package com.biwin.common.app.basic;

import cn.hutool.core.collection.CollUtil;
import com.biwin.common.api.constant.BwSystemConstant;
import com.biwin.common.api.dto.IBwQueryDto;

import java.util.LinkedList;
import java.util.List;

/**
 * TODO
 *
 * @author biwin
 * @since 0.0.1
 */
public class BwQueryDto implements IBwQueryDto {

    private List<BwCondition> conditionList;

    private String orderBy;

    private String[] orderBys;

    private String groupBy;

    private String[] groupBys;

    private String sort = BwSystemConstant.ORDER_DESC;

    private boolean initialized = false;

    private void initQuery() {
        if (CollUtil.isEmpty(conditionList) && !initialized) {
            conditionList = new LinkedList<>();
            BwCondition condition = BwCondition.newEffectCondition();
            conditionList.add(condition);
        }
    }
}
